from django.db import models
# Create your models here.


class Student(models.Model):
    user_name = models.CharField(max_length=64)
    password = models.CharField(max_length=64, default='123456')
    sex = models.CharField(max_length=8)
    address = models.CharField(max_length=16)
    sign = models.CharField(max_length=64)
    img = models.CharField(max_length=128, default=' ')

    def __str__(self):
        return str(self.user_name)


class Grade(models.Model):
    python = models.CharField(max_length=64)
    java = models.CharField(max_length=64)
    vue = models.CharField(max_length=64)
    linux = models.CharField(max_length=64)
    student_id = models.ForeignKey(Student, on_delete=models.CASCADE)  # 外键

    def __str__(self):
        return str(self.id)


class DutyLog(models.Model):
    user_name = models.CharField(max_length=64)
    date_time = models.CharField(max_length=64)

    def __str__(self):
        return str(self.id)
